package com.igeek.d0607;

import com.sun.source.tree.NewArrayTree;

import java.io.*;
import java.util.Scanner;

/**
 * @Author: zhiyu
 * @Date:17:51
 * @DESC:
 */
public class Test2 {
    static {
        System.out.println("com.igeek.d0607.Test2被加载了");
    }
    public static void systemIn(){
        System.out.println("请输入您要录入的信息：");
        String path = Test2.class.getResource("").getPath();
        try (
                InputStream in = System.in;
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                PrintWriter printWriter =
                        new PrintWriter(path.substring(1)+"user.txt");
        ){
            String s = "";
            while ((s= br.readLine())!=null){
                printWriter.println(s);
                printWriter.flush();
            }
             }catch (Exception e){
                 e.printStackTrace();
             }
    }

    public static void main(String[] args) {
        systemIn();
    }
}
